package com.glela.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.glela.platform.constant.ErrorEnum;
import com.glela.platform.model.TalentJob;
import com.glela.platform.model.request.RequestUserModel;
import com.glela.platform.model.response.ResponseBaseModel;
import com.glela.platform.service.TalentJobSerice;
import com.glela.platform.util.ParameterUtils;
@Controller
@RequestMapping(value = "/talentJob")
public class TalentJobController {
	@Autowired
	private TalentJobSerice TalentJobSerice;
	
	/**
	 * 讲师认证
	 * 
	 * @param requestUserSet
	 * @returns
	 */
	@ResponseBody
	@RequestMapping(value = "/addTalentJobByUserId", method = RequestMethod.POST, consumes = "application/json")
	public ResponseEntity<?> addTalentJobByUserId(@RequestBody RequestUserModel requestUserModel) {
			if (ParameterUtils.validParams(requestUserModel.getUserId(),requestUserModel.getUserName(),requestUserModel.getPassword())) {
				return new ResponseEntity<>(new ResponseBaseModel(ErrorEnum.C20102), HttpStatus.OK);
			}
			return TalentJobSerice.addTalentJobByUserId(requestUserModel.getUserId(),requestUserModel.getUserName(),requestUserModel.getPassword());
}
	
	/**
	 * 修改讲师信息
	 * 
	 * @param requestUserSet
	 * @returns
	 */
	@ResponseBody
	@RequestMapping(value = "/chengeTalentJobByNo", method = RequestMethod.POST, consumes = "application/json")
	public ResponseEntity<?> chengeTalentJobByNo(@RequestBody TalentJob talentJob) {
			if (ParameterUtils.validParams(talentJob.getJobNo())) {
				return new ResponseEntity<>(new ResponseBaseModel(ErrorEnum.C20102), HttpStatus.OK);
			}
			return TalentJobSerice.chengeTalentJobByNo(talentJob);
}
}
